<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
      charset="UTF-8"
    />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta content="telephone=no" name="format-detection" />
    <title>信丰县南山寺·善行愿祈</title>
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/html2canvas.min.js"></script>
    <script src="js/qrcode.min.js"></script>
    <link
      rel="stylesheet"
      href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"
    />
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
    <script src="js/pinchzoom.js"></script>
    <script src="js/base.js?v=2"></script>
    <script src="js/sha1.js"></script>
    <link rel="stylesheet" href="css/style.css" />
  </head>
  <body>
    <div class="loading fixed" style="display: none">
      <section>
        <div class="loader loader-20"></div>
      </section>
    </div>
    <div class="main index" id="app">
      <div class="homeTop">
        <img src="img/home/img1.png" class="fullImg" />
        <img src="img/home/img3.png" class="intro" />
        <p class="xingshanTimes">已有<span v-text="renshu"></span>人次行善</p>
        <div class="notice" v-show="notice.length>0">
          <div class="notice_active">
            <ul
              ref="con1"
              :class="{anim:animate==true}"
              @mouseenter="mEnter"
              @mouseleave="mLeave"
            >
              <li class="notice_active_ch" v-for="(i,index) in notice">
                {{i.blessName}}{{i.createTime}}，愿：{{i.content}}
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="homeCon">
        <div class="home_nav">
          <p :class="{active : navIndex==1}" @click="navIndex=1;">
            <span>虔心祈愿</span>
          </p>
          <p
            :class="{active : navIndex==2}"
            @click="navIndex=2;zanpage=1;xspage=1;xslist=[];zanlist=[];jilu();"
          >
            <span>行善记录</span>
          </p>
        </div>
        <div class="qiyuan" v-show="navIndex==1">
          <div class="one">
            <div class="name">
              <div class="fayuan">
                <label>发愿人：</label>
                <p class="input">
                  <input type="text" v-model="blessName" />
                </p>
              </div>
              <div class="changyong" v-show="zengname.length>0">
                <label>常用名：</label>
                <p class="changname tlcolor">
                  <span v-for="(i,index) in zengname" @click="blessName = i"
                    >{{i}}<e v-if="index==0">;</e></span
                  >
                </p>
              </div>
            </div>
            <div class="duixiang">
              <span>祈愿对象：</span>
              <label :class="{active : duixiang==1}" @click="duixiang=1">
                <span></span>
                自己
              </label>
              <label :class="{active : duixiang==2}" @click="duixiang=2">
                <span></span>
                他人
                <p class="input">
                  <input type="text" v-model="tarenname" />
                </p>
              </label>
            </div>
          </div>
          <div class="xinyuan">
            <div>
              <p
                :class="{active : xinyuanIndex == index}"
                v-for="(i,index) in blessContentList"
                @click="xinyuanIndex=index;blessContent=''"
              >
                {{i}}
              </p>
            </div>
            <p class="input">
              <input
                type="text"
                placeholder="自填心愿"
                v-model="blessContent"
                @keyup="zitian"
              />
            </p>
          </div>
          <div class="xingshan">
            <div class="xsfl">
              <img src="img/home/xin.png" />
              <span>随喜行善</span>
            </div>
            <input type="number" @blur="onShanQBlur" v-model="shanQ" />
            <span class="danwei">元</span>
          </div>
          <div class="dingyue">
            <div class="dingyue_fl">
              <h2>每日自动行善<span>（每月30天）</span></h2>
              <p>每天早上6点帮你自动行善一次</p>
            </div>
            <div class="dingyue_fr">
              <div class="switchBox">
                <input
                  id="checked_1"
                  type="checkbox"
                  class="switch"
                  v-model="monthlyPackage"
                />
                <label for="checked_1"></label>
              </div>
            </div>
          </div>
          <p class="xingshanBtn" @click="lijixs()">
            <img src="img/home/btn.png" />
          </p>
        </div>
        <div class="jilu" v-show="navIndex==2">
          <div class="search">
            <div class="con">
              <img src="img/search.png" />
              <input
                type="text"
                placeholder="请输入要搜索的人名"
                v-model="keyWord"
              />
            </div>
            <span @click="search()">搜索</span>
          </div>
          <div class="jiluCon">
            <ul>
              <li v-for="(i,index) in xslist" @click="godetail(i)">
                <div class="info">
                  <div class="info_fl">
                    <img :src="i.headPic" class="tx" />
                    <div>
                      <h3>发愿人：{{i.blessName}}</h3>
                      <p><span>累计行善{{i.goodDays}}天</span></p>
                    </div>
                  </div>
                  <!-- <div class="gongde">
                功德<span>+10</span>
              </div> -->
                </div>
                <div class="msg">愿：{{i.blessContent}}</div>
                <div class="other">
                  <span>{{i.createTime}}</span>
                  <p
                    class="weizan zan"
                    :class="{yizan : i.hasHelp!=0}"
                    @click="zan(i.id,index)"
                  >
                    <img src="img/xi.png" v-show="i.hasHelp==0" />
                    <img src="img/xi1.png" v-show="i.hasHelp!=0" />
                    <span>众缘赞叹{{i.helperNum}}</span>
                  </p>
                </div>
              </li>
            </ul>
          </div>
          <div class="tips">
            点击他人行善记录中的红心<img
              src="img/xi1.png"
            />，众愿赞叹，共修功德。
          </div>
        </div>
      </div>

      <div class="homeCon zanlist" v-show="navIndex==2">
        <p class="title">众缘赞叹记录</p>
        <div class="con">
          <ul>
            <li v-for="(i,index) in zanlist">
              <p class="tit1">
                {{i.helperName}}为{{i.blessName}}的善行，众缘赞叹，共修功德。
              </p>
              <div class="zanlist_b">
                <p class="zanlist_date">{{i.time}}</p>
                <!-- <p class="gongde">
              功德<span>+10</span>
            </p> -->
              </div>
            </li>
          </ul>
        </div>
      </div>
      <div class="bottomImg">
        <img src="img/home/h5-1.png" class="fullImg" />
        <img src="img/home/h5-2.png" class="fullImg" />
      </div>
      <div class="fixed nav">
        <p class="active">
          <img src="img/home2.png" />
          <span>首页</span>
        </p>
        <p @click="window.location.href='./my.html'">
          <img src="img/my1.png" />
          <span>我的</span>
        </p>
      </div>

      <div
        class="fixed black tankuang zhifu"
        style="display: none"
        :style="{'display':zhifuShow ?'block' :'none'}"
        v-show="zhifuShow"
      >
        <div class="con">
          <img
            src="img/close.png"
            class="close"
            @click="zhifuShow=false;month=1"
          />
          <p class="tit1">善款</p>
          <p class="shankuan">
            <span>￥{{zongmoney[0]}}</span>.{{zongmoney[1]}}元
          </p>
          <div class="yuan">
            <p>善行愿祈</p>
            <p>
              <span>
                愿：<e v-show="duixiang==2">{{tarenname}}</e>{{blessContent1}}
              </span>
            </p>
          </div>
          <div class="shijian" v-show="monthlyPackage">
            <p class="tit2">自动行善时间（月）</p>
            <div class="number">
              <span
                class="minus"
                @click="if(month==1){return false};month--;add()"
                >-</span
              >
              <input type="number" v-model="month" />
              <span class="plus" @click="month++;add()">+</span>
            </div>
          </div>
          <div class="zizhi" @click="siinfoShow=true">
            <img src="img/1.png" class="img1" />
            <div>
              <h3>本活动获得的资质和许可</h3>
              <div>
                授权单位：
                <p>
                  <span>信丰县南山寺</span>
                  <span>信丰县佛教协会</span>
                </p>
              </div>
            </div>
            <p class="chakan">
              <span>查看</span>
            </p>
          </div>
          <p class="btn" @click="xingshan()">
            <img src="img/home/btn1.png" class="fullImg" />
          </p>
        </div>
      </div>

      <div
        class="fixed black tankuang siinfo"
        style="display: none"
        :style="{'display':siinfoShow ?'block' :'none'}"
        v-show="siinfoShow"
      >
        <div class="con">
          <p class="title">
            基础信息
            <img src="img/close.png" class="close" @click="siinfoShow=false" />
          </p>
          <div class="info">
            <p>宗场证字（赣）：F070540001 号</p>
            <p>主体信息：信丰县南山寺</p>
            <p style="display: flex">
              <span>所在地址：</span>
              <span style="flex: 1"
                >江西省赣州市信丰县嘉定镇阳明南路南山古寺</span
              >
            </p>
          </div>
          <div class="infoimg">
            <p>资质信息</p>
            <p>
              <span class="img" @click="chakan('img/home/zz1.png')">
                <img src="img/home/zz1.png" />
              </span>
              <span class="img" @click="chakan('img/home/zz2.jpg')">
                <img src="img/home/zz2.jpg" />
              </span>
            </p>
          </div>
          <p class="btn" @click="siinfoShow=false">
            <img src="img/home/btn3.png" class="fullImg" />
          </p>
        </div>
      </div>
      <div
        class="fixed black xsdetail"
        style="display: none"
        :style="{'display':detailShow ?'flex' :'none'}"
        v-if="detailShow"
      >
        <div class="box">
          <div class="con">
            <div class="xs_yuan">
              <div class="xs_yuan_xx">
                <img :src="detail.headPic" class="headimg" />
                <div class="nickname">
                  <p>发愿人：{{detail.blessName}}</p>
                  <p class="leiji">
                    <span>累计行善{{detail.blessDays}}天</span>
                  </p>
                </div>
                <div class="xs_yuan_jl">
                  <p class="gongde">善款<span>{{detail.money}}元</span></p>
                  <p class="gongde">
                    累计功德<span>{{detail.goodScore}}</span>
                  </p>
                </div>
              </div>
              <div class="info">{{detail.blessContent}}</div>
            </div>
            <div class="zhuchi">
              <div class="zhuchi_xx">
                <img src="img/si.jpg" class="headimg" />
                <p>谛静法师</p>
                <p>
                  <span>当值法师</span>
                </p>
              </div>
              <div class="info">
                @{{detail.blessName}}善信菩萨吉祥🌹！赞叹善信菩萨恒持善行👍三宝兴隆、龙天加护！祝愿：三业清净，违缘消灭，善业增长，身心安乐、家庭幸福，事业圆满，合家康宁！福光常注照，诸方好运享安宁，常行胜因善缘，吉祥安康！🙏🙏🙏
              </div>
            </div>
            <p class="title gongde">
              本次善行收到的众缘赞叹<span>{{detail.helperNum}}</span>人
            </p>
            <div class="zantan" v-show="detailhelplist.records.length>0">
              <ul>
                <li v-for="(i,index) in detailhelplist.records">
                  <div class="tit">
                    <p>善信{{i.name}}为本次善行，众缘赞叹，随喜功德。</p>
                  </div>
                  <div>
                    <p>
                      <span>{{i.time}}</span>
                    </p>
                    <!-- <p class="gongde">
                  功德<span>+10</span>
                </p> -->
                  </div>
                </li>
              </ul>
            </div>
            <p class="btn">
              <img
                src="img/btn1.png"
                class="xsbtn"
                @click="detailShow=false;navIndex=1;"
              />
              <img src="img/btn.png" class="sharebtn" @click="share()" />
            </p>
          </div>
          <img src="img/close1.png" class="close" @click="detailClose()" />
        </div>
      </div>
      <div
        class="fixed poster"
        style="display: none"
        :style="{'display':posterShow ?'block' :'none'}"
        v-if="posterShow"
      >
        <img
          src="./img/back.png"
          @click="clearPoster"
          class="back-icon"
          alt=""
        />
        <div class="img-box" v-show="!dataURL" v-loading="!dataURL">
          <img class="share-img" :src="shareImg" alt="" />
          <p class="word font-style">
            随喜赞叹@{{detail.blessName}}
            善行愿祈，心灯常亮，众缘赞叹，共修功德。
          </p>
          <p class="font-style" style="margin-top: 0.1rem; width: 1.67rem">
            愿：{{blessContent}}
          </p>
          <p class="tip-text">长按分享图片&nbsp;>>></p>
          <div id="qrcode"></div>
          <p class="tip-text" style="right: 0.12rem; left: auto">
            长按识别二维码
          </p>
        </div>
        <!-- <img class="tip-img" src="./img/btn-share.png" alt=""> -->
        <div class="img-box" v-show="dataURL">
          <img class="share-img" :src="dataURL" />
        </div>
      </div>
      <div
        class="fixed picZom black"
        style="display: none"
        @click="closepiczom"
      >
        <div class="picZom-box">
          <div class="pinch-zoom">
            <img
              src=""
              class="fullImg"
              @click="window.event? window.event.cancelBubble = true : e.stopPropagation();"
            />
          </div>
        </div>
      </div>
    </div>
    <script src="font/shareImgs.js"></script>
    <script>
      var vm;
      var blessContent = "";
      var monthlyPackage;
      var code = url.code;
      var payment = "";
      var code = url.code; //['1111','2222','3333']
      $(function () {
        $(".picZom").click(function () {
          // console.log("1111");
          $("div.pinch-zoom").each(function () {
            new RTP.PinchZoom($(this), {});
          });
          $(".picZom").hide();
        });
        $(".picZom img").click(function (e) {
          e.stopPropagation();
        });

        vm = new Vue({
          el: "#app",
          data: {
            shareImg: share1,
            dataURL: "",
            posterShow: false,
            renshu: 0,
            notice: [],
            notice1: [],
            animate: false,
            timer1: "",
            zengname: [],
            navIndex: 1,
            duixiang: 1,
            tarenname: "",
            blessContentList: [
              "顶礼十方，供养三宝 ",
              "平安喜乐，顺吉如意",
              "恭敬顶礼，五方五佛",
              "学业增进，智慧增长",
              "欢喜发心，善愿坚定",
              "冤情俱超，得生安养",
            ],
            xinyuanIndex: "-1",
            blessName: "",
            blessContent: "",
            blessContent1: "",
            shanQ: "",
            monthlyPackage: "",
            zongmoney: [],
            zhifuShow: false,
            month: 1,
            siinfoShow: false,
            detailShow: false,

            keyWord: "",
            xslist: [],
            xspage: 1,
            xspagesize: 10,
            zanlist: [],
            zanpage: 1,
            zanpagesize: 10,
            isjiluScroll: true,
            iszanScroll: true,

            benzanpage: 1,
            benzanpagesize: 10,
            detail: "",
            detailhelplist: [],

            dingshi: "",
            detailId: "",
          },

          mounted() {
            let that = this;
            //share();

            if (code == undefined || code == "" || code == null) {
              // alert('没有code')
              window.location.href =
                "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx84b42f343347ca80&redirect_uri=" +
                encodeURIComponent("http://www.baoyuesi.com.cn/") +
                "&response_type=code&scope=snsapi_userinfo&state=" +
                new Date().getTime() +
                "#wechat_redirect ";
            } else {
              that.denglu();
            }

            $("div.pinch-zoom").each(function () {
              new RTP.PinchZoom($(this), {});
            });

            if (getCookie("zengname") != undefined) {
              var name = getCookie("zengname").split(",");
              name = new Set([...name]);
              that.zengname.push(...name);
              // console.log(getCookie("zengname"));
              // console.log(that.zengname);
            }
            that.info();
            //that.jilu();
            that.dingshi = setInterval(that.info, 30000);

            $(".jiluCon").scroll(function () {
              var scrollTop = $(this).scrollTop();
              var scrollHeight = $(".jiluCon ul").height();
              var windowHeight = $(this).height();
              // console.log(scrollTop + windowHeight);
              // console.log(scrollHeight);
              if (scrollTop + windowHeight + 10 >= scrollHeight) {
                // console.log("加载更多");
                if (that.isjiluScroll) {
                  that.isjiluScroll = false;
                  that.xspage++;
                  that.jilu();
                }
              }
            });

            $(".zanlist .con").scroll(function () {
              var scrollTop = $(this).scrollTop();
              var scrollHeight = $(".zanlist .con ul").height();
              var windowHeight = $(this).height();
              // console.log(scrollTop + windowHeight);
              // console.log(scrollHeight);
              if (scrollTop + windowHeight + 10 >= scrollHeight) {
                // console.log("加载更多");
                if (that.iszanScroll) {
                  that.iszanScroll = false;
                  that.zanpage++;
                  that.jilu();
                }
              }
            });

            document.onreadystatechange = function () {
              // console.log(document.readyState);
              if (document.readyState == "complete") {
                $(".loading").hide();
              }
            };
          },
          methods: {
            onShanQBlur() {
              if (Number(this.shanQ) < 0.01) {
                this.shanQ = 0.01;
              } else {
                this.shanQ = Number(this.shanQ).toFixed(2);
              }
            },
            clearPoster() {
              this.dataURL = "";
              this.posterShow = false;
            },
            denglu() {
              let that = this;
              var code1 = code;
              jQuery.post(
                api + "app/goodMan/login",
                { code: code1 },
                function (res) {
                  if (res.code == 200) {
                    userId = res.data.id;
                    setCookie("headimg", res.data.headPic);
                    setCookie("nickname", res.data.name);
                    setCookie("userId", userId);
                  }
                }
              );
            },
            info() {
              let that = this;
              jQuery.get(api + "app/goodMan/getFirstPage", {}, function (res) {
                if (res.code == 200) {
                  var notice = JSON.stringify(res.data.contentList);
                  that.renshu = res.data.goodNum;
                  that.notice = JSON.parse(notice);
                  that.notice1 = JSON.parse(notice);
                  clearInterval(that.timer1);
                  that.timer1 = setInterval(that.scroll, 3000);
                }
              });
            },
            jilu() {
              let that = this;
              var url =
                api +
                "app/goodMan/getGoodRecordHelpInfo/" +
                userId +
                "/" +
                that.xspage +
                "/" +
                that.xspagesize +
                "/" +
                that.zanpage +
                "/" +
                that.zanpagesize;
              // console.log(url);
              jQuery.get(url, { keyWord: that.keyWord }, function (res) {
                // console.log(res);
                if (res.code == 200) {
                  // console.log(res.data.goodList.records);

                  if (that.isjiluScroll && that.iszanScroll) {
                    that.xslist.push(...res.data.goodList.records);
                    that.zanlist.push(...res.data.helpList.records);
                  }

                  if (that.isjiluScroll == false) {
                    that.xslist.push(...res.data.goodList.records);
                    that.isjiluScroll = true;
                  }

                  if (that.iszanScroll == false) {
                    that.zanlist.push(...res.data.helpList.records);
                    that.iszanScroll = true;
                  }
                }
              });
            },
            search() {
              let that = this;
              that.xspage = 1;
              that.xslist = [];
              that.jilu();
            },
            scroll() {
              let con1 = this.$refs.con1;

              con1.style.marginTop = "-30px";
              this.animate = !this.animate;
              var that = this; // 在异步函数中会出现this的偏移问题，此处一定要先保存好this的指向
              setTimeout(function () {
                //that.notice.push(that.notice[0]);
                //console.log(that.notice)
                var lis = that.notice.shift();
                // console.log(lis);
                //console.log(that.notice.length)
                con1.style.marginTop = "0px";
                that.animate = !that.animate; // 这个地方如果不把animate 取反会出现消息回滚的现象，此时把ul 元素的过渡属性取消掉就可以完美实现无缝滚动的效果了
              }, 500);

              if (that.notice.length == 2) {
                that.notice.push(...that.notice1);
              }
            },
            mEnter() {
              clearInterval(this.timer1);
            },
            mLeave() {
              this.timer1 = setInterval(this.scroll, 3000);
            },
            zitian() {
              this.xinyuanIndex = "-1";
            },
            lijixs() {
              let that = this;
              that.zongmoney = [];
              if (that.monthlyPackage) {
                var zongmoney = String((that.shanQ * 30).toFixed(2));
              } else {
                var zongmoney = String(that.shanQ);
              }
              if (zongmoney.indexOf(".") > 0) {
                console.log("有小数点");
                zongmoney = zongmoney.split(".");
                console.log(zongmoney);
                that.zongmoney = zongmoney;
              } else {
                that.zongmoney[0] = zongmoney;
                that.zongmoney[1] = "00";
              }
              // console.log(that.zongmoney);

              if (that.xinyuanIndex == "-1") {
                blessContent = that.blessContent;
              } else {
                blessContent = that.blessContentList[that.xinyuanIndex];
              }

              that.blessContent1 = blessContent;

              if (that.duixiang == 2) {
                //他人
                blessContent = that.tarenname + blessContent;
              }

              if (that.monthlyPackage) {
                monthlyPackage = that.month;
              } else {
                monthlyPackage = 0;
              }

              if (that.blessName == "") {
                toastText("请输入发愿人姓名");
                return false;
              }
              if (blessContent == "") {
                toastText("请输入祈祷内容");
                return false;
              }
              if (that.shanQ == "") {
                toastText("请输入行善金额");
                return false;
              }

              that.zhifuShow = true;
            },
            xingshan() {
              let that = this;
              var d = {
                blessContent: blessContent,
                blessName: that.blessName,
                money: Number(that.shanQ),
                monthlyPackage: monthlyPackage,
                userId: userId,
              };
              // console.log(d);

              jQuery.post(api + "app/goodMan/doGood", d, function (res) {
                if (res.code == 200) {
                  if (getCookie("zengname") == undefined) {
                    var zengname = that.blessName;
                    setCookie("zengname", zengname);
                  } else {
                    var zengname = getCookie("zengname");
                    zengname = zengname.split(",");
                    zengname = [...new Set(zengname)];
                    if (zengname.length == 1) {
                      zengname.push(that.blessName);
                      zengname = zengname.join(",");
                      setCookie("zengname", zengname);
                    } else {
                      zengname.shift();
                      zengname.push(that.blessName);
                      zengname = zengname.join(",");
                      setCookie("zengname", zengname);
                    }
                  }
                  // console.log(zengname);
                  // that.zengname = zengname.split(",");

                  payment = res.data.body;
                  if (typeof WeixinJSBridge == "undefined") {
                    if (document.addEventListener) {
                      document.addEventListener(
                        "WeixinJSBridgeReady",
                        onBridgeReady,
                        false
                      );
                    } else if (document.attachEvent) {
                      document.attachEvent(
                        "WeixinJSBridgeReady",
                        onBridgeReady
                      );
                      document.attachEvent(
                        "onWeixinJSBridgeReady",
                        onBridgeReady
                      );
                    }
                  } else {
                    onBridgeReady();
                  }
                  // that.zengname = [...new Set(zengname.split(","))];
                }
              });
            },
            zan(id, index) {
              window.event
                ? (window.event.cancelBubble = true)
                : e.stopPropagation();
              let that = this;
              if (that.xslist[index].hasHelp == 1) {
                return false;
              }
              var d = { recordId: id, userId: userId };
              jQuery.post(api + "/app/goodMan/doHelp", d, function (d) {
                if (d.code == 200) {
                  toastText("赞叹成功");
                  that.xslist[index].hasHelp = 1;
                  that.xslist[index].helperNum++;
                }
              });
            },
            godetail({ id, blessContent }) {
              this.blessContent = blessContent;
              let that = this;
              that.detailId = id;
              var url =
                api +
                "/app/goodMan/recordDetail/" +
                userId +
                "/" +
                id +
                "/" +
                that.benzanpage +
                "/" +
                that.benzanpagesize;
              jQuery.get(url, function (res) {
                if (res.code == 200) {
                  that.detail = res.data;
                  // console.log(res.data);
                  that.detailhelplist = res.data.helpInfoList;
                  // console.log(that.detailhelplist);
                  that.detailShow = true;
                }
              });
            },
            add() {
              let that = this;
              that.zongmoney = [];
              var zongmoney = String((that.shanQ * 30 * that.month).toFixed(2));
              // console.log(zongmoney);
              // console.log(zongmoney.indexOf("."));
              if (zongmoney.indexOf(".") > 0) {
                console.log("有小数点");
                zongmoney = zongmoney.split(".");
                console.log(zongmoney);
                that.zongmoney = zongmoney;
              } else {
                that.zongmoney[0] = zongmoney;
                that.zongmoney[1] = "00";
              }
              // console.log(that.zongmoney);
            },
            share() {
              this.posterShow = true;
              this.detailShow = false;
              this.$nextTick(() => {
                let urls = window.location.host;
                let queryString = window.location.href.split("?")[1];
                let codeDom = document.getElementById("qrcode");
                let code = new QRCode(codeDom, {
                  text: `http://${urls}/share.html?recordId=${this.detailId}`, // 字符串
                  // text: `http://${urls}/share.html?recordId=${this.detailId}&${queryString}`, // 字符串
                  width: 70,
                  height: 70,
                });
                html2canvas(document.querySelector(".img-box"), {}).then(
                  (canvas) => {
                    this.dataURL = canvas.toDataURL("image/png");
                  }
                );
                jQuery.post(
                  api + "app/goodMan/adminForward",
                  { recordId: this.detailId },
                  (res) => {
                  
                  }
                );
              });
              // window.location.href='./share.html?recordId='+this.detailId;
              // share(this.detailId);
            },
            detailClose() {
              this.detailShow = false;
              share();
            },
            chakan(url) {
              $(".picZom img").attr("src", url);
              $(".picZom").show();
            },
            closepiczom() {
              $("div.pinch-zoom").each(function () {
                new RTP.PinchZoom($(this), {});
              });
              $(".picZom").hide();
            },
          },
        });
      });

      function onBridgeReady() {
        WeixinJSBridge.invoke(
          "getBrandWCPayRequest",
          {
            appId: payment.appId, //公众号名称，由商户传入
            timeStamp: payment.timeStamp, //时间戳，自1970年以来的秒数
            nonceStr: payment.nonceStr, //随机串
            package: payment.package,
            signType: payment.signType, //微信签名方式：
            paySign: payment.paySign, //微信签名
          },
          function (res) {
            // console.log(res);
            if (res.err_msg == "get_brand_wcpay_request:ok") {
              toastText("支付成功");
              vm.zhifuShow = false;
            } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
              alert("您取消了支付……");
            } else {
              alert("支付失败!");
            }
          }
        );
      }
    </script>
  </body>
</html>
